const Request = require('@/utils/sys-request.js'); // 上传文件

const uploadFile = (imgpath, folder, succ) => {
    return Request._upload(imgpath, folder, succ);
}; // 轮播

const banner = (formData) => {
    return Request._get('banner/all', formData, true);
}; // 店铺轮播

const storeBannerBasic = (formData) => {
    return Request._get('store/banner/all', formData, true);
}; //首页导航

const indexLabel = (formData) => {
    return Request._get('index/getLabel', formData, true);
}; //店铺首页导航

const indexStoreLabel = (formData) => {
    return Request._get('index/getStoreLabel', formData, true);
}; // 首页列表

const indexList = (json) => {
    return Request._get('index/list', json, true);
}; 

// 获取session
const getSessionKey = (formData) => {
    return Request._post('login/getsessionkey', formData);
}; // 登陆

const login = (formData) => {
    return Request._post('login/onLogin', formData);
};
//获取验证码
const getCode = (formData) => {
    return Request._post('login/getCode', formData);
};

//手机号码登录
const loginPhone = (formData) => {
    return Request._post('login/loginPhone', formData);
};


//更新用户昵称和头像
const updateUser = (formData) => {
    return Request._post('user/updateUserWx', formData);
}; 


//用户协议

const getProtocol = (formData) => {
    return Request._get('index/getProtocol', formData, true);
}; // 商品分类

const goodsType = () => {
    return Request._get('index/type');
}; 
// 商品详情

const goodsDetail = (formData) => {
    return Request._get('goods/detail', formData, true);
}; // 商品一级分类

const goodsTypeFirst = () => {
    return Request._get('goods/getTypeFirst');
}; // 商品二级分类

const goodsTypeSecond = (formData) => {
    return Request._get('goods/getTypeSecond', formData, true);
}; // 商品二级分类

const getTypeGoods = (formData) => {
    return Request._get('goods/getTypeGoods', formData, true, false);
}; //商品常用清单

const goodsInventory = (formData) => {
    return Request._get('goods/getGoodsInventory', formData, true);
}; // 点赞收藏

const upOrCollect = (formData) => {
    return Request._post('user/upOrCollect', formData, true);
}; // 分享次数加一

const shareAdd = (formData) => {
    return Request._post('goods/shareAdd', formData);
}; // 用户商品推广图片

const createQRcode = (formData) => {
    return Request._post('goods/createQRcode', formData, true);
}; // 添加购物车

const goodsAddCart = (formData) => {
    return Request._post('user/addCart', formData, true, false, false);
}; // 我的购物车

const goodsMyCart = (formData) => {
    return Request._post('user/myCart', formData, true, false, false);
}; // 修改我的购物车

const goodsCartEdit = (formData) => {
    return Request._post('user/cartEdit', formData, true, false, false);
}; // 删除我的购物车

const goodsCartDelete = (formData) => {
    return Request._post('user/cartDelete', formData, true);
}; // 订单显示

const orderShow = (formData) => {
    return Request._post('order/show', formData, true);
}; // 订单生成

const orderCreate = (formData) => {
    return Request._post('order/create', formData, true);
}; // 用户地址列表

const userAddressList = () => {
    return Request._get('user/addressList', {}, true);
}; // 用户地址保存

const userAddressSave = (formData) => {
    return Request._post('user/addressSave', formData, true);
}; // 获取用户地址单条

const userAddressOne = (formData) => {
    return Request._get('user/addressOne', formData, true);
}; // 删除地址

const userAddressDelete = (formData) => {
    return Request._post('user/addressDelete', formData, true);
}; // 支付展示

const payOrderShow = (formData) => {
    return Request._post('pay/orderShow', formData, true);
}; // 确认支付-微信支付

const payConfirm = (formData) => {
    return Request._post('pay/confirm', formData, true);
}; // 查询支付-微信支付

const payQuery = (formData) => {
    return Request._get('pay/payQuery', formData, true);
}; // 个人中心

const userCore = (formData) => {
    return Request._post('user/core', formData, true);
}; //获取 积分--收益规则

const getRule = (formData) => {
    return Request._get('user/getRule', formData, true);
}; // 收藏点赞

const userCollectOrUp = (formData) => {
    return Request._post('user/collectOrUp', formData, true);
}; // 积分记录

const userIntegral = (formData) => {
    return Request._post('user/integral', formData, true);
}; //余额记录

const userBalanceLog = (formData) => {
    return Request._post('user/userBalanceLog', formData, true);
}; // 用户收益记录

const userEarnings = (formData) => {
    return Request._post('user/earnings', formData, true);
}; // 用户收益提现

const userEarningExtract = (formData) => {
    return Request._post('user/earningExtract', formData, true);
}; // VIP展示

const userVipList = (formData) => {
    return Request._get('user/vipList', formData, true);
}; // 用户订单

const userOrderList = (formData) => {
    return Request._get('user/orderList', formData, true);
}; //用户订单详情

const userOrderDetail = (formData) => {
    return Request._post('user/orderDetail', formData, true);
}; //用户消费情况统计

const userOrderStatistics = (formData) => {
    return Request._post('user/getOrderStatistics', formData, true);
}; //用户填写退货单号

const userOrderOutLogistics = (formData) => {
    return Request._post('user/orderOutLogistics', formData, true);
}; //绑定推广用户

const userTop = (formData) => {
    return Request._post('user/userTop', formData, true);
}; //获取推广用户的列表

const userPopList = (formData) => {
    return Request._post('user/userPopList', formData, true);
}; // 热门词

const indexHotKeyword = (formData) => {
    return Request._get('index/hotKeyword', formData, true);
}; // 商品搜索

const indexGoodsSearch = (formData) => {
    return Request._get('index/goodsSearch', formData, true);
}; // 取消订单

const userCancelOrder = (formData) => {
    return Request._post('user/cancelOrder', formData, true);
}; // 申请退款退货

const userOutOrder = (formData) => {
    return Request._post('user/outOrder', formData, true);
}; // 确认收货

const userConfirmTake = (formData) => {
    return Request._post('user/confirmTake', formData, true);
}; // 订单物流

const userOrderLogistics = (formData) => {
    return Request._post('user/orderLogistics', formData, true);
}; //用户获取物流列表

const userLogisticsList = (formData) => {
    return Request._get('user/getLogisticsList', formData, true);
}; // 代理商个人中心

const agencyCore = (formData) => {
    return Request._post('agency/core', formData, true);
}; // 获取文章详情

const getArticle = (formData) => {
    return Request._get('agency/article', formData, true);
}; // 代理商收益

const agencyEarnings = (formData) => {
    return Request._post('agency/earnings', formData, true);
}; //代理商收益提现

const agencyEarningsExtract = (formData) => {
    return Request._post('agency/earningsExtract', formData, true);
}; // 代理商库存

const agencyStores = (formData) => {
    return Request._post('agency/stores', formData, true);
}; // 代理商设置物流

const agencyLogistics = (formData) => {
    return Request._post('agency/logistics', formData, true);
}; //代理商查看物流信息

const agentGetLogistics = (formData) => {
    return Request._post('agency/agentGetLogistics', formData, true);
}; //代理商发货物流信息

const orderSendDetail = (formData) => {
    return Request._post('agency/orderSendDetail', formData, true);
}; //代理商待发货物列表

const agentSendItem = (formData) => {
    return Request._post('agency/agentSendItem', formData, true);
}; //代理商订单详情

const agentOrderDetail = (formData) => {
    return Request._post('agency/orderDetail', formData, true);
}; // 代理商转单给平台

const agencyCareSystem = (formData) => {
    return Request._post('agency/careSystem', formData, true);
}; // 代理商物流公司列表

const agencyLogisticsList = (formData) => {
    return Request._get('agency/logisticsList', formData, true);
}; // 代理商订单

const agencyOrderList = (formData) => {
    return Request._post('agency/orderList', formData, true);
}; // 代理商退换订单

const agencyOutOrderHandle = (formData) => {
    return Request._post('agency/outOrderHandle', formData, true);
}; // 代理商补货订单显示

const agencyOrderShow = (formData) => {
    return Request._post('agency/agencyOrderShow', formData, true);
}; // 代理商补货订单生成

const agencyOrderCreate = (formData) => {
    return Request._post('agency/agencyOrderCreate', formData, true);
}; // 代理商补货订单列表

const agencyStoreOrderList = (formData) => {
    return Request._post('agency/agencyOrderList', formData, true);
}; // 代理商补货订单-取消

const agencyOrderCancel = (formData) => {
    return Request._post('agency/agencyOrderCancel', formData, true);
}; // 获取图文列表

const getArticleList = (formData) => {
    return Request._get('article/articleList', formData, true);
}; // 获取图文导航列表

const getNavList = (formData) => {
    return Request._get('article/navList', formData, true);
}; // 获取图文详情

const getArticleInfo = (formData) => {
    return Request._get('article/articleInfo', formData, true);
}; //提交商家认证信息

const userAddBusiness = (formData) => {
    return Request._post('user/addBusiness', formData, true);
}; //获取商家认证信息

const userGetBusiness = (formData) => {
    return Request._get('user/getBusiness', formData, true);
};

// 分类趣豆商城首页分类
const gameGoodsType = (formData) => {
    return Request._get('game/goodsType', formData, true);
}; 

// 分类趣豆商城首页商品
const gameGoodsIndex = (formData) => {
    return Request._get('game/goodsIndex', formData, true);
};

//趣豆专区礼包商品
const gameGoodsGift = (formData) => {
    return Request._get('game/goodsGift', formData, true);
};


//趣豆盲盒中心
const getGameCore = (formData) => {
    return Request._get('game/getGameCore', formData, true);
};

//参与盲盒游戏
const joinGameProcess = (formData) => {
    return Request._get('game/joinGameProcess', formData, true);
};

// 盲盒游戏开将
const openGameProcess = (formData) => {
    return Request._get('game/openGameProcess', formData, true);
};

// 获取我的奖品
const getGameCardList = (formData) => {
    return Request._get('game/getGameCardList', formData, true);
};

//获取我的兑换券
const getCouponList = (formData) => {
    return Request._get('game/getCouponList', formData, true);
};

//开启盲盒
const openGameCard = (formData) => {
    return Request._get('game/openGameCard', formData, true);
};
//卡片合成盲盒
const comGameCard = (formData) => {
    return Request._get('game/comGameCard', formData, true);
};

//开启盲盒记录
const getGameRecord = (formData) => {
    return Request._get('game/getGameRecord', formData, true);
};

//获取趣豆记录
const getUserBean = (formData) => {
    return Request._get('game/getUserBean', formData, true);
};

//获取趣豆收益总量
const getUserTotalBean = (formData) => {
    return Request._get('game/getUserTotalBean', formData, true);
};

//获取趣豆收益统计情况
const getUserStatisticsBean = (formData) => {
    return Request._get('game/getUserStatisticsBean', formData, true);
};

//获取趣豆收益记录
const getUserTotalBeanPage = (formData) => {
    return Request._get('game/getUserTotalBeanPage', formData, true);
};
//趣豆提现
const userBeanExtract = (formData) => {
    return Request._get('game/userBeanExtract', formData, true);
};

module.exports = {
    uploadFile,
    banner,
    storeBannerBasic,
    indexLabel,
    indexStoreLabel,
    indexList,
    getSessionKey,
    login,
	getCode,
	loginPhone,
	updateUser,
	
    getProtocol,
    goodsType,
    goodsDetail,
    goodsTypeFirst,
    goodsTypeSecond,
    getTypeGoods,
    goodsInventory,
    upOrCollect,
    shareAdd,
    createQRcode,
    goodsAddCart,
    goodsMyCart,
    goodsCartEdit,
    goodsCartDelete,
    orderShow,
    orderCreate,
    userAddressList,
    userAddressSave,
    userAddressOne,
    userAddressDelete,
    payOrderShow,
    payConfirm,
    payQuery,
    userCore,
    getRule,
    userCollectOrUp,
    userIntegral,
    userBalanceLog,
    userEarnings,
    userEarningExtract,
    userVipList,
    userOrderList,
    userOrderDetail,
    userTop,
    userPopList,
    indexHotKeyword,
    indexGoodsSearch,
    userCancelOrder,
    userOutOrder,
    userConfirmTake,
    userOrderLogistics,
    userLogisticsList,
    userOrderStatistics,
    userOrderOutLogistics,
    agencyCore,
    getArticle,
    agencyEarnings,
    agencyEarningsExtract,
    agencyStores,
    agencyLogistics,
    agentGetLogistics,
    orderSendDetail,
    agentSendItem,
    agentOrderDetail,
    agencyCareSystem,
    agencyLogisticsList,
    agencyOrderList,
    agencyOutOrderHandle,
    agencyOrderShow,
    agencyOrderCreate,
    agencyStoreOrderList,
    agencyOrderCancel,
    getArticleList,
    getNavList,
    getArticleInfo,
    userAddBusiness,
    userGetBusiness,
	
	gameGoodsType,
	gameGoodsIndex,
	gameGoodsGift,
	getGameCore,
	joinGameProcess,
	openGameProcess,
	getGameCardList,
	getCouponList,
	openGameCard,
	comGameCard,
	getGameRecord,
	
	getUserBean,
	getUserTotalBean,
	getUserStatisticsBean,
	getUserTotalBeanPage,
	userBeanExtract
};
